package com.qh.xx;

/**
 * @description:
 * @author: zqh
 * @date: 2021/11/6 0:16
 **/
public class Car implements Comparable<Car>{
    private int age ;

    public Car(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return age + "";
    }

    @Override
    public int compareTo(Car e) {
        return age - e.getAge();
    }
}
